package net.tngou.iask.action.my;

import net.tngou.iask.action.BaseAction;
import net.tngou.iask.jdbc.PageUtil;
import net.tngou.iask.service.AccessService;
import net.tngou.iask.service.CureService;
import net.tngou.iask.service.PatientService;
import net.tngou.iask.util.IDUtil;

/**
 * 常用功能
 * @author tngou@tngou.net
 *
 */
public class UsedAction extends BaseAction {

	/**
	 * 待完成的随访
	 */
	public void access() {
		int state = (int) ask.getId();
		AccessService service = new AccessService();
		PageUtil page = service.getPage(ask.getPage(), ask.getSize(), user.getMain(), 2,state, ask.getKeyword());
		root.put("page", page);
		root.put("state", state);
		root.put("IDUtil", new IDUtil());
		printFreemarker("my/used_access.ftl", root);
		
	}
	
	/**
	 * 治疗患者
	 */
	public void cure() {
		int type = (int) ask.getId();
		CureService service = new CureService();
		PageUtil page = service.getPage(ask.getPage(), ask.getSize(), user.getMain(),type, ask.getKeyword());
		root.put("page", page);
		root.put("IDUtil", new IDUtil());
		printFreemarker("my/used_cure.ftl", root);
	}
	
	/**
	 * 患者
	 */
	public void patient() {
		PatientService service = new PatientService();
		PageUtil page = service.getPageUser(ask.getPage(), ask.getSize(), user.getId(), ask.getKeyword());
		root.put("page", page);
		printFreemarker("my/used_patient.ftl", root);
	}
}
